<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
	
<link rel="stylesheet" href="css/sidebar.css">
	<%@page import="hibernate.constraint.Constraint"%>
<%@ page import="org.hibernate.SessionFactory"%>
<%@ page import="org.hibernate.Session"%>
<%@ page import="hibernate.method.*"%>
<%@ page import="hibernate.model.*"%>
<%@ page import="hibernate.util.HibernateUtil"%>
<div class="reservations">

	<div style="text-align:center">
		<div class="title">
			<h3>REZERWACJE</h3>
		</div>
	</div>
<%
Integer user_id = (Integer) session.getAttribute("user_id");
response.setContentType("text/html");
SessionFactory sessionFactory = HibernateUtil.getSessionAnnotationFactory();
Session s= sessionFactory.openSession();
s.beginTransaction();
UserMethods um = new UserMethods();
if (user_id == null || um.getUserType(sessionFactory, s, user_id) == null) {
%>
<!-- <div id="reservations_content">Dostep zabroniony dla niezalogowanych uzytkownikow</div>-->
<div class="menu_simple">
		<ul>
			<li><a class="newReservation" href="index.jsp?page=reservations&group=newReservation">NOWA REZERWACJA</a></li>
			</ul>
	</div>

	<div id="reservations_content">
	<jsp:include page="reservations/reservations_content.jsp"></jsp:include>
		</div>

<% } 
else
	if ("client".equals(um.getUserType(sessionFactory, s, user_id))){

	%>



	<div class="menu_simple">
		<ul>
			<li><a class="newReservation" href="index.jsp?page=reservations&group=newReservation">NOWA REZERWACJA</a></li>
			<li><a class="currentReservations" href="index.jsp?page=reservations&?group=currentReservations">ZARZĄDZAJ</a></li>
		</ul>
	</div>

	<div id="reservations_content">
	<jsp:include page="reservations/reservations_content.jsp"></jsp:include>
		</div>

<% } s.getTransaction().commit();%>
</div>
	